import { ref } from "vue";
import { defineStore } from "pinia";
import { sysApi } from "@/api";
import type { Setting } from "@/type/setting.ts";

export const useCounterStore = defineStore("counter", () => {
  const config = ref<Setting>({
    allowRobots: "N",
    copyright: "",
    description: "",
    icon: "",
    icp: "",
    id: 0,
    keyWord: "",
    logo: "",
    metaDesc: "",
    pub: "",
    robots: "",
    seoTitle: "",
    subtitle: "",
    sysIsComment: "Y",
    sysIsRegister: "N",
    sysSComment: "N",
    websiteName: "",
  });
  const getSysConfig = async () => {
    config.value = await sysApi.getConfig();
  };
  return {
    config,
    getSysConfig,
  };
});
